//
//
//  Generated by StarUML(tm) C++ Add-In
//
//  @ Project : OOAD5T
//  @ File Name : EventBus.h
//  @ Date : 2026-05-03
//  @ Author : 
//
//


#if !defined(_EVENTBUS_H)
#define _EVENTBUS_H

#include <vector>
#include <functional>

class SensorProvider;

class EventBus {
public:
	using startCleaningCallBack = std::function<void()>;
	using avoidObstacleCallBack = std::function<void(SensorProvider* sender)>;
	using detectDustCallBack = std::function<void()>;
	using turnOffCallBack = std::function<void()>;

	void publishStartCleaning();
	void subScribeStartCleaning(startCleaningCallBack cb);
	void publishAvoidObstacle(SensorProvider* sender);
	void subScribeAvoidObstacle(avoidObstacleCallBack cb);
	void publishDetectedDust();
	void subScribeDetectedDust(detectDustCallBack cb);
	void publishTurnOff();
	void subScribeTurnOff(turnOffCallBack cb);

private:
	std::vector<startCleaningCallBack> startCleaningSubs;
	std::vector<avoidObstacleCallBack> avoidObstacleSubs;
	std::vector<detectDustCallBack> detectedDustSubs;
	std::vector<turnOffCallBack> turnOffSubs;
};

#endif  //_EVENTBUS_H
